﻿; (function (window, undefined, $) {
    $(document).ready(function () {
        var gridopt = {
            url: options.listUrl,
            colModel: [
                   { display: '编号', name: 'Id', width: "5%", sortable: true, hide: true, align: 'left', iskey: true },
                    { display: '项目标题', name: 'ProjectName', width: "10%", sortable: false, align: 'left' },
                    { display: '项目分类', name: 'ProjectClassName', width: "7%", sortable: false, align: 'left' },
                    { display: '筹资金额(元)', name: 'Amount', width: "7%", sortable: false, align: 'left' },
                    { display: '筹集天数', name: 'CollectDays', width: "7%", sortable: false, align: 'left' },
                    //{ display: '一句话说明', name: 'ProjectAdWord', width: "7%", sortable: false, align: 'left' },
                    //{ display: '项目简介', name: 'ProjectSummary', width: "7%", sortable: false, align: 'left' },
                    //{ display: '项目详情', name: 'ProjectDetails', width: "7%", sortable: false, align: 'left' },
                    //{ display: '视频介绍', name: 'VideoAddr', width: "7%", sortable: false, align: 'left' },
                    //{ display: '首屏图片', name: 'ProjectThumImage', width: "7%", sortable: false, align: 'left' },
                    //{ display: '预热图片', name: 'ProjectThumImage1', width: "7%", sortable: false, align: 'left' },
                    { display: '创建时间', name: 'Createtime', width: "7%", sortable: false, align: 'left' },
               
                    //{ display: '审核时间', name: 'AuditTime', width: "7%", sortable: false, align: 'left' },
                    //{ display: '未通过理由', name: 'RefuseReason', width: "7%", sortable: false, align: 'left' },
                    { display: '发布者', name: 'MemberName', width: "7%", sortable: false, align: 'left' },
                    { display: '审核管理员', name: 'Admin', width: "7%", sortable: false, align: 'left' },
                    { display: '操作', name: 'Id', width: "13%", sortable: false, align: 'center', process: processOp }
            ],
            sortname: "Id",
            sortorder: "ASC",
            title: false,
            rp: 15,
            usepager: true,
            showcheckbox: false
        };
        var xjgrid = new xjGrid("gridlist", gridopt);
        function processOp(value, cell) {
            var ops = [];
            ops.push("&nbsp;<a title='重新审核' href='javascript:;'  onclick=\"util.ReturnToAuditing('", value, "')\"><i class='fa fa-edit' class='fa fa-trash-o'></i>重新审核</a>");
            return ops.join("");
        }

        $("#formQuery").submit(function () {
            xjgrid.Query(this);
            return false;
        });

        $("#btnSearch").click(function () {
            $("#formQuery").submit();
        });

        util.ReturnToAuditing = function (id) {
            var url = options.returnToAuditing + "/" + id;
            location.href = url;
        };

    });

})(window, undefined, jQuery);